home *** CD-ROM | disk | FTP | other *** search
/ Singles Flirt Up Your Life! (German) / Singles Flirt Up Your Life.iso / data1.cab / Statemachine / questTrouble3a.lua < prev    next >
Text File  |  2004-01-29  |  2KB  |  65 lines

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questTrouble3 entered");
  6.         setState("initial");
  7.     end )
  8.     
  9.     -- on game over: relationship conditions get reset to 0 and all quests are reset to initial
  10.     onMsg("questreset", function(msg)
  11.         setState("initial");
  12.     end ) 
  13. ---------------------------------------------------------------------------------------------------------------------------------------    
  14.     
  15.     state("initial") 
  16.         onMsg("checkCondition", function(msg)
  17.             local mike = getParent().getParent().getCharacter(MIKE);
  18.             local elaine = getParent().getParent().getCharacter(ELAINE);
  19.  
  20.             if elaine.getRelationshipCondition(MIKE, REL_TROUBLE) >= 3
  21.             then
  22.             
  23.                 elaine.queueCommand("pm_talkCutscene", "talkCutscene", mike, "questTrouble3a");
  24.                 setState("talktome");
  25.             else
  26.             if mike.getRelationshipCondition(ELAINE, REL_TROUBLE) >= 3
  27.             then
  28.                 mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questTrouble3a");
  29.                 setState("talktome");
  30.             end
  31.             end
  32.         end )
  33.         
  34.         
  35.     state("talktome")
  36.         -- assoon as arrived - start dialog
  37.         onMsg("talking", function(msg)
  38.             if ( msg.data == "questTrouble3a" ) then
  39.                 if msg.sender == getParent().getParent().getCharacter(ELAINE).getUniqueID() then
  40.                     popupConversation("dialogTrouble3a");
  41.                 else
  42.                     popupConversation("dialogTrouble3b");
  43.                 end
  44.                 setState("donetalktome");
  45.             end
  46.         end )
  47.         
  48.     state("donetalktome");
  49.         onMsg("yes", function(msg)
  50.             getParent().getParent().getCharacter(MIKE).cancelCurrentActivity();
  51.             getParent().getParent().getCharacter(ELAINE).cancelCurrentActivity();
  52.             setState("done");
  53.         end )
  54.         
  55. ---------------------------------------------------------------------------------------------------------------------------------------    
  56.  
  57.         
  58.     state("done")
  59.     
  60.     -- sackgasse hier
  61.         
  62.         
  63.         
  64. endStateMachine()
  65.